const express = require('express');
const path = require('path');
const app = express();

//模板配置
app.engine('art',require('express-art-template'));
app.set('views',path.join(__dirname,'views'));
app.set('view engine','art');

//所有模板都能拿到
app.locals.users = [{
    name: '李泽言',
    rank: '倔强青铜',
},{
    name: '黑夜的猫不是喵',
    rank: '百强大佬',
}]

app.get('/index',(req,res) =>{
    res.render('index',{
        msg:'首页'
    });
});

app.get('/list',(req,res) =>{
    res.render('list',{
        msg:'列表页'
    })
})

//端口监听
app.listen(3000);